package org.keyuan.dao.impl;

import java.util.Set;

import org.hibernate.Session;
import org.keyuan.dao.EmployeeDao;
import org.keyuan.entity.Employee;
import org.keyuan.entity.PurviewGroup;

public class EmployeeDaoImpl extends DaoSupport<Employee> implements EmployeeDao{

	@Override
	public void updateEmpPurviewGroupDao(Employee emp) {
		Set<PurviewGroup> purviewGroups=emp.getGroups();
		Session session=this.getSession();
		emp=(Employee)session.get(Employee.class, emp.getEmpId());
		emp.getGroups().clear();
		emp.setGroups(purviewGroups);
		session.update(emp);
	}

}
